<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>博尔塔拉职业技术学校</title>
<link rel="stylesheet" type="text/css" href="statics/custom/custom.css">
<link rel="stylesheet" type="text/css" href="statics/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="statics/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="statics/easyui/themes/color.css">
<script src="statics/js/jquery/jquery-1.11.1.min.js"></script>
<script src="statics/easyui/jquery.easyui.min.js"></script>
<script src="statics/easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="statics/easyui/datagrid-detailview.js"></script>
<script src="statics/easyui/datagrid-filter.js"></script>
<script src="statics/custom/custom.js"></script>
<script src="statics/custom/easyui.extends.js"></script>
<script src="statics/custom/easyui.crudgrid.extends.js"></script>
<script src="statics/custom/easyui.dialog.extends.js"></script>
<script src="statics/custom/easyui.tabs.extends.js"></script>
<script src="statics/custom/pinyin.js"></script>
<script type="text/javascript">
	function showView(container, title, src, id) {
		var tabContainer = $(container);
		if (tabContainer.tabs('existsById', id)) {
			var tab = tabContainer.tabs('getTabById', id); // 获取选中的选项卡
			var currentTab = tabContainer.tabs('getSelected');
			if (tab == currentTab) {
				tab.panel('refresh', src);
			} else {
				tabContainer.tabs('selectById', id); //将选中的tab设为当前tab
			}
		} else {
			tabContainer.tabs('add', {
				'id' : id,
				'title' : title,
				'href' : src,
				'closable' : true,
				'tools' : [ $.tabs.panel.buttons.refresh ]
			});
		}
	}

	function showTab(container, title, src) {
		var tabContainer = $(container);
		if (tabContainer.tabs('exists', title)) {
			var tab = tabContainer.tabs('getTab', title); // 获取选中的选项卡
			var currentTab = tabContainer.tabs('getSelected');
			if (tab == currentTab) {
				tab.panel('refresh', src);
			} else {
				tabContainer.tabs('select', title); //将选中的tab设为当前tab
			}
		} else {
			tabContainer.tabs('add', {
				'title' : title,
				'href' : src,
				'closable' : true,
				'tools' : [ $.tabs.panel.buttons.refresh ]
			});
		}
	}

	$(function() {
		$.ajaxform.options.tabContainerId = 'tabContainer';

		$('#tabContainer').tabs({
			fit : true,
			tools : [ {
				title : '关闭其他所有选项卡',
				iconCls : 'icon-error',
				handler : function() {
					$.tabs.getContainer(this).tabs('closeExceptCurrent');
				}
			}, {
				title : '关闭左侧所有选项卡',
				iconCls : 'icon-tab-close-left',
				handler : function() {
					$.tabs.getContainer(this).tabs('closeLeft');
				}
			}, {
				title : '关闭右侧所有选项卡',
				iconCls : 'icon-tab-close-right',
				handler : function() {
					$.tabs.getContainer(this).tabs('closeRight');
				}
			}, {
				title : '关闭所有选项卡',
				iconCls : 'icon-cross',
				handler : function() {
					$.tabs.getContainer(this).tabs('closeAll');
				}
			} ]
		});

		$('#tabContainer  .tabs-tool a.l-btn').each(function() {
			var $button = $(this);
			var $text = $button.children().children('span.l-btn-text');
			$button.prop('title', $button.data('linkbutton').options.title).tooltip({
				position : 'bottom'
			});
		});

		$("#menu .easyui-tree").tree({
			onClick : function(node) {
				if (node.text != undefined && node.href != undefined) {
					showTab('#tabContainer', node.text, node.href);
				}
			}
		});
	})
</script>
</head>
<body>
	<div id="dialog" class="easyui-dialog" data-options="closed:true"></div>
	<div id="mainLayout" class="easyui-layout hidden" data-options="fit: true">
		<div data-options="region:'north'" style="height: 50px; background: url(statics/images/logo.png); padding: 8px;">
			<div style="float: right; padding-top: 20px; color: #FFFFFF">
				<span>当前用户：<sec:authentication property="principal.name"></sec:authentication></span><a href="#" onclick="javascript:$.dialog.open({width:440,height:220,href:'sys/user/self/password?action=sys/user/self/password',title:'修改密码',buttons : [ $.dialog.buttons.save, $.dialog.buttons.reset, $.dialog.buttons.close ],onSubmitSuccess:function(data, options){$.dialog.close();}})" style="text-decoration: none; color: #FFFFFF; padding-left: 5px;">修改密码</a> <a href="logout" style="text-decoration: none; color: #FFFFFF; padding-left: 5px;">注销</a>
			</div>
		</div>
		<div data-options="region:'center'">
			<div class="easyui-layout" data-options="fit:true">
				<div data-options="region:'west',title:'菜单导航栏'" style="width: 180px;">
					<div id="menu" class="easyui-accordion" data-options="fit:true">
					<sec:authorize access="hasRole('HRM_LIST')">
						<div title="人事管理" data-options="iconCls:'icon-options'">
							<ul class="easyui-tree">
								<sec:authorize access="hasRole('IDCADE_EDIT')">
									<li><a href="hrm/idCade/manage">身份证录入</a></li> 
								</sec:authorize>
								<sec:authorize access="hasRole('HRM_EDIT')">
									<li data-options="href:'sys/user/manage'">员工管理</li>
									<li><span>导入导出</span>
										<ul>
											<li><a href="sys/user/exportSpan">生成员 工导入空表</a></li>
											<li data-options="href:'sys/user/exprotManage'">导出员工数据基本数据</li>
											<li data-options="href:'sys/user/importHrmManage'">导入员工基本数据</li>									
										</ul>
									</li>
								</sec:authorize>
								<sec:authorize access="hasRole('HRM_DIC')">
									<li><span>字典管理</span>
										<ul>
											<li data-options="href:'hrm/dic/certificateType/manage?title=员工状态&entityName=hrm/dic/employeeStatus'">员工状态</li>
											<li data-options="href:'hrm/dic/certificateType/manage?title=学历类型&entityName=hrm/dic/educationType'">学历类型</li>
										</ul>
									</li>
								</sec:authorize>
							</ul>
						</div>
					</sec:authorize>
						<sec:authorize access="hasRole('SAFE_REGISTER') or hasRole('SAFE_LIST')">
							<div title="安全维稳" data-options="iconCls:'icon-options'">
								<ul class="easyui-tree">
									<sec:authorize access="hasRole('SAFE_REGISTER')">
											<li><a href="security/gard/gard">进校门登记</a></li>
									</sec:authorize>
									<sec:authorize access="hasRole('SAFE_LIST')">
										<li data-options="href:'security/gard/manage'">进门登记查询</li>
									</sec:authorize>
									<sec:authorize access="hasRole('IDCADE_EDIT')">
										<li><a href="hrm/idCade/manage">身份证录入</a></li> 
									</sec:authorize>
								</ul>
							</div>
						</sec:authorize>
						<sec:authorize access="hasRole('TEACHING_HDFB') or hasRole('TEACHING_XSBM')">
						<div title="教务管理" data-options="iconCls:'icon-options'">
							<ul class="easyui-tree">
								<sec:authorize access="hasRole('TEACHING_HDFB')">
									<li data-options="href:'teaching/enroll/manage'">活动发布</li>
								</sec:authorize>
								<sec:authorize access="hasRole('TEACHING_XSBM')">
									<li data-options="href:'teaching/participant/manage'">活动报名</li>
								</sec:authorize>
							</ul>
						</div>
						</sec:authorize>
						<div title="员工资料" data-options="iconCls:'icon-options'">
							<ul class="easyui-tree">
								<sec:authorize access="hasRole('DATA_DIC')">
									<li data-options="href:'file/dataType/manage'">员工资料类型</li>
								</sec:authorize>
								<li data-options="href:'file/data/manage'">员工个人资料管理</li>
							</ul>
						</div>
						<sec:authorize access="hasRole('STUDENT_EDIT') or hasRole('BJ_EDIT')">
							<div title="学生管理" data-options="iconCls:'icon-options'">
								<ul class="easyui-tree">
									<sec:authorize access="hasRole('BJ_EDIT')">
										<li data-options="href:'student/class/manage'">班级管理</li>
									</sec:authorize>
									<sec:authorize access="hasRole('STUDENT_EDIT')">
										<li data-options="href:'student/student/manage'">学生管理</li>
										<li><a href="student/student/exportSpan">生成学生导入表模板</a></li>
										<li data-options="href:'student/student/importStuManage'">导入学生数据</li>
									</sec:authorize>
								</ul>
							</div>
						</sec:authorize>
						<sec:authorize access="hasRole('SYS_DEPT') or hasRole('SYS_ROLE')">
							<div title="系统管理" data-options="iconCls:'icon-options'">
								<ul class="easyui-tree">
									<sec:authorize access="hasRole('SYS_DEPT')">
										<li data-options="href:'sys/dept/manage'">部门管理</li>
									</sec:authorize>
									<!-- <li data-options="href:'sys/position/manage'">岗位管理</li> -->
									<sec:authorize access="hasRole('SYS_ROLE')">
										<li data-options="href:'sys/role/manage'">角色管理</li>
										
									</sec:authorize>
								</ul>
							</div>
						</sec:authorize>
						<sec:authorize access="hasRole('DEVELOPMENT_MODE')">
							<div title="开发模式" data-options="iconCls:'icon-options'">
								<ul class="easyui-tree">
									<li data-options="href:'sys/type/manage'">类型设置</li>
									<li data-options="href:'sys/permission/manage'">权限设置</li>
									<li data-options="href:'sys/role/manage'">角色管理</li>
									<li data-options="href:'sys/dept/manage'">部门管理</li>
									<li><a href="hrm/idCade/manage">身份证录入</a></li> 
									<li data-options="href:'sys/user/manage'">员工管理</li>
									<%-- <li><span>字典管理</span>
										<ul>
											<li data-options="href:'root/nation/manage'">民族</li>
										</ul>
									</li> --%>
								</ul>
							</div>
						</sec:authorize>
					</div>
				</div>
				<div data-options="region:'center'">
					<div id="tabContainer" style="padding: 1px;">
						<div title="首页" style="padding: 10px;" data-options="tools:[$.tabs.panel.buttons.refresh]">首页</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
